// /*
//  * @Author: WanYiMing
//  * @Date:2024-07-02-10:39
//  * @Description:
//  */

using Code.GameLogic.XianJian.Controller;
using UnityEngine;

namespace Code.GameLogic.XianJian.XianJianBehavior.Action
{
    public class ActLockingAttackTarget
    {
        private float _lastAttackTime;
        private int _act;
        private double _asp;
        private XianJianController _XianJianController;

        public ActLockingAttackTarget(XianJianController XianJianController)
        {
            _act = XianJianController.bo.MainBehavior.Act;
            _asp = XianJianController.bo.MainBehavior.Asp;
            _XianJianController = XianJianController;
        }

        public void Attack(GameObject tTargetBox,string actionCode)
        {
            if (Time.time - _lastAttackTime >= _asp)
            {
                // 执行攻击逻辑
                _XianJianController.jianQiController.ActiveBehaviour(tTargetBox,actionCode);
                _lastAttackTime = Time.time; // 更新上次攻击时间
            }
        }
    }
}